﻿using UnityEngine;
namespace UGUIMan
{
    public class Light:MonoBehaviour
    {
        public bool loopback;
        public float max=300,min=10
            ;
        private void Update()
        {
            if (loopback)
            {
                transform.Rotate(0, 1, 0);
            }
            else
            {
                transform.Rotate(0, -1, 0);
            }
            if (transform.rotation.eulerAngles.y+360 % 360 < min)
            {
                loopback = true;
            }else if (transform.rotation.eulerAngles.y+360 % 360 > max)
            {

            }
            if (transform.rotation.eulerAngles.y < 0)
            {
                transform.Rotate(0, 360, 0);
            }

        }
    }
}